﻿@model IEnumerable<Citi.GocAttributes.WebUI.Models.TypeRuleResultModel>

<table class="table table-bordered table-striped">
    <tr>
        <th>
            Value
        </th>
        <th>
            Last Update
        </th>
        <th>
        </th>
    </tr>
    @if (!Model.Any())
    {
        <tr>
            <td colspan="4">
                There's no data
            </td>
        </tr>
    }
    @foreach (var item in Model.OrderBy(x => x.Value))
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Value)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.LastUpdate)
            </td>
            <td>
                @Ajax.ActionLink("Edit", "Form",
                    new { type = item.Type, id = item.Id },
                            new AjaxOptions { UpdateTargetId = "otAttributesForm", OnBegin = "$('#otAttributesCreate').modal('toggle')" },
                    new { @class = "icon-pencil" })
                @Ajax.ActionLink("Delete", "Delete",
                 new { id = item.Id, type = item.Type }, new AjaxOptions { UpdateTargetId = "otAttributesList", Confirm = "Are you sure?" },
                    new { @class = "icon-remove" })
            </td>
        </tr>
    }
</table>
